/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.hazardsource.service.api;

import com.koron.common.bean.StaffBean;
import com.koron.hazardsource.domain.HazardSource;
import org.springframework.web.multipart.MultipartFile;
import org.swan.bean.MessageBean;

import java.util.List;

public interface HazardSourceService {


    /**
     * 根据查询条件获取标准危险源列表
     * @param name
     * @param businessTypeId
     * @param hazardTypeId
     * @param state
     * @param start
     * @param rows
     * @return
     */
    List<HazardSource> queryByCondition(String table, String name, String indicationLevelId,Integer riskLevelStart,Integer riskLevelEnd, String businessTypeId, String hazardTypeId, Boolean fitAllBusiness, Integer state,
                                        Integer start, Integer rows);
 

    /**
     * 根据查询条件统计标准危险源总数
     * @param table
     * @param name
     * @param businessTypeId
     * @param hazardTypeId
     * @param state
     * @return
     */
    Integer countByCondition(String table, String name, String indicationLevelId,Integer riskLevelStart,Integer riskLevelEnd, String businessTypeId, String hazardTypeId, Boolean fitAllBusiness, Integer state);


    /**
     * 根据id查询标准危险源详情
     * @param table
     * @param id
     * @return
     */
    HazardSource queryOneById(String table, String id);

    /**
     * 导入标准危险源
     * @param user
     * @param file
     * @param title
     * @param note
     * @return
     * @throws Exception
     */
    MessageBean<?> importFromExcel(StaffBean user, MultipartFile file, String title, String note) throws Exception;


    /**
     * 保存标准危险源和风险列表
     * @param hsList
     * @return
     */
    List<String> saveSourceAndRisk(List<HazardSource> hsList);


    /**
     * 保存草稿
     * @param hsList
     * @param user
     * @return
     */
    @SuppressWarnings("rawtypes")
    MessageBean<List> saveSourceAndRiskDraft(List<HazardSource> hsList, StaffBean user);


    /**
     * 新增危险源提交操作
     * @param hsList
     * @param user
     * @param title
     * @param note
     * @return
     */
    MessageBean<?> submitSourceAndRisk(List<HazardSource> hsList, StaffBean user, String title, String note);


    /**
     * 废弃危险源
     * @param idList
     * @param user
     * @param title
     * @param note
     * @return
     */
    MessageBean<Boolean> discard(List<String> idList, StaffBean user, String title, String note);


    /**
     * 获取草稿列表
     * @param user
     * @return
     */
    MessageBean<?> getDraftList(StaffBean user);

    /**
     * 历史版本
     * @param code
     * @return
     */
    MessageBean<?> getHistoryList(String code);
    /**
     * 审批流相关的业务数据
     * @param ids
     * @return
     */
    MessageBean<?> getProcessData(String ids);
    
    MessageBean<?> deleteDraft(String id);
}
